/*
 * TableroSDL.h
 *
 *  Created on: 23/10/2013
 *      Author: fernando
 */

#ifndef TABLEROSDL_H_
#define TABLEROSDL_H_

#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "SDL.h"
#include <vector>
#include <string>
#include "CeldaSDL.h"
#include "Golosina.h"
#include "Puntaje.h"

const int SIZEEXTRA = 400;

class TableroSDL : public SDL {
public:
	TableroSDL(int columns, int rows);
	virtual ~TableroSDL();
	int dibujar();
	int dibujarSinCeldas();
	bool addCeldaSDL(CeldaSDL*);
	bool setCeldas(std::vector<CeldaSDL*> celdas);
	void manejarMovimientoMouse(SDL_Event*);
	void intercambiar(CeldaSDL*, CeldaSDL*);
	Golosina* getGolosinaConPosicion(unsigned int, unsigned int);
	CeldaSDL* getCeldaFromPos(unsigned int, unsigned int);
	CeldaSDL* getCelda(unsigned int);
	void setFondo(std::string);
	unsigned int getPosCorner(unsigned int);
	unsigned int getTotalCeldas();
	unsigned int getNumeroColumnas();
	unsigned int getNumeroFilas();
	unsigned int getAncho();
	void createPuntajes(unsigned int jugadores, unsigned int x, std::vector<std::string>);
	void sumarPuntos(unsigned int nJugador, long puntos);

private:
	unsigned int columnas;
	unsigned int filas;
	std::vector<CeldaSDL*> celdas;
	SDL_Surface* fondo;
	std::vector<Puntaje*> puntajes;
};

#endif /* TABLEROSDL_H_ */
